package com.tt.fashionWebSite.dao.jpa;

import com.tt.fashionWebSite.dao.TapLuatKetHopDao;
import com.tt.fashionWebSite.domain.TapLuatKetHop;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import javax.persistence.Query;
import java.util.List;

/**
 * Created by isoft-work 5 on 1/11/2015.
 */
@Repository("tapLuatKetHop")
public class TapLuatKetHopJpaDao extends GenericJpaDao<TapLuatKetHop, Long> implements TapLuatKetHopDao {
   public TapLuatKetHopJpaDao() {
      super(TapLuatKetHop.class);
   }

   public void deleteAll() {
      Query q1 = getEntityManager().createQuery("DELETE FROM TapLuatKetHop");
      q1.executeUpdate();
   }

   public List<TapLuatKetHop> getAll() {
      return getEntityManager().createNamedQuery(TapLuatKetHop.GET_ALL, TapLuatKetHop.class).getResultList();
   }
}
